$(document).ready(function() {
    SetTimeOut();//10秒倒计时
	Button();
}) 
	//10秒倒计时
function SetTimeOut() {
	 $(function(){
        var i=10;
        var countdown = null;
        function timeShow(){
            i--;
            $("#time").html(i);
            if(i<1){
                clearInterval(countdown);
                var value = getcookie("key");
				if(value == "industry"){
					window.location.href = "/IndustryStandard";
				}
				if(value == "operate"){
					window.location.href = "/CooperativePartner";
				}
				setcookie("key","");//清空cookie
            }
        };
        countdown = setInterval(timeShow,1000);
   })
}

/**
 * @description
 *   获取cookie值的方法
 * @author xwt
 * @createDate 2017.1.9
 * @version V0.0.1
 */
function getcookie(name){
	var arr = document.cookie.split("; ")
		for(var i=0;i<arr.length;i++){
			var arr1= arr[i].split("=");
			for (var j=0;j<arr1.length;j++){
				if(arr1[0]==name){
					return arr1[1];
				}
			}
		}
		return "";
	}
function setcookie(name,value,iDay)
{
	var oDate = new Date();
	oDate.setDate(oDate.getDate()+iDay);
	document.cookie=name+"="+value+";expires="+oDate+"; path=/";
}
function Button(){
	var Main = new Vue({
		el:'.jump_box',
		methods: {
			GoBackAdd(){
				var value = getcookie("key");
				if(value == "industry"){
					window.location.href = "/AddIndustryStandard";
				}
				if(value == "operate"){
					window.location.href = "/AddNewPic";
				}
				setcookie("key","");//清空cookie
			},
			GoBackList(){
				var value = getcookie("key");
				if(value == "industry"){
					window.location.href = "/IndustryStandard";
				}
				if(value == "operate"){
					window.location.href = "/CooperativePartner";
				}
				setcookie("key","");//清空cookie
			}
		}
	})
}
/**
 * @description
 * 阻止浏览器往后返回
 * @author xwt
 * @createDate 2017.1.10
 * @version V0.0.1
 */
function StopBack(){
	if (window.history && window.history.pushState) {
			
			$(window).on('popstate', function () {
				window.history.pushState('forward', null, '#');
			    window.history.forward(1);
				window.location.reload()
				
			});
		}
	window.history.pushState('forward', null, '#'); //在IE中必须得有这两行
	window.history.forward(1);
}